// 模板
import { defineStore } from 'pinia'

const state = () => ({
  template: [1, 2, 3, 4], // 模板
})

const getters = {}

const actions = {
  // 设置 State
  setState({ key, value }: { key: S; value: any }) {
    this[key] = value
  },
}

export const useStore = (id: S) =>
  defineStore({ id, state, getters, actions })()
